<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="com.cap.bts.framework.usermgnt.constant.EmployeeStatus"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>信息推送历史</title>
<%@include file="../include/include.jsp"%>
<link rel="stylesheet" type="text/css" href="${csspath }/public.css" />
<link rel="stylesheet" type="text/css" href="${csspath }/datepicker.css" />
<link rel="stylesheet" type="text/css" href="${csspath }/style_l.css" />
<script type="text/javascript" src="${jspath }/jquery-1.8.3.js"></script>
<script type="text/javascript" src="${jspath }/jquery.ui.min.js"></script>
<script type="text/javascript" src="${jspath }/ui.datepicker_zh-CN.js"></script>
<script type="text/javascript" src="${jspath }/jquery.blockUI.js"></script>
<script type="text/javascript" src="${jspath }/public.js"></script>
<script type="text/javascript" src="${jspath }/jquery.selectAll.js"></script>
<script type="text/javascript"
	src="${jspath}/jquery/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="${jspath}/jquery/jquery.alerts.js"></script>
<script type="text/javascript" src="${jspath}/load_layer.js"></script>
<link rel="stylesheet" type="text/css"
	href="${csspath}/jquery.alerts.css" />

<link rel="stylesheet" type="text/css"
	href="${webcontext}/css/validationEngine.jquery.css" />
<script src="${jspath}/jquery/validate/jquery.validationEngine.js"
	type="text/javascript"></script>
<script src="${jspath}/jquery/validate/jquery.validationEngine-zh.js"
	type="text/javascript"></script>
<script type="text/javascript"
	src="${webcontext}/javascript/jquery/jquery.ui.draggable.js"></script>
<link rel="stylesheet" type="text/css"
	href="${bootstrapPath}/css/bootstrap.css" />
<script type="text/javascript" src="${bootstrapPath}/js/bootstrap.js"></script>
<style type="text/css">
.checkbox-li {
	display: inline-block;
	width: 100px;
}
</style>
<script type="text/javascript">
	var myHeight = 0;
	$(function() {
		$("#search_form").validationEngine({
			promptPosition : "topLeft",
			success : false,
			validationEventTriggers : "blur",
			scroll : false,
			failure : function() {
			}
		});
	});

	function search() {
		if($("#qRemindStartDate").val() == "" || $("#qRemindStartDate").val() == null){
			jAlert(
					"请选择推送日期！",
					"提示");
			return false;
		}
		search_form.action = "${webcontext}/crmdp/dealer/remind/toRemindHistory";
		document.getElementById("search_form").submit();
	}

	function returnRemind() {
// 		search_form.action = "${webcontext}/crmdp/dealer/remind/toRemind";
// 		document.getElementById("search_form").submit();
		window.location.href= "${webcontext}/crmdp/dealer/remind/toRemind?dealerNum=${param.dealerNum}";
	}

	function resertChange() {
		$("#startDate").val() = '${ maxRemindDate }';
	}
</script>
</head>
<body>
	<div id="content">
		<div class="spliter h_5"></div>
		<div class="page_info"></div>
		<div class="spliter h_5"></div>
			<form:form class="form-horizontal" id="search_form" method="post"
				modelAttribute="dto">
				<div class="row">
					<div class="form-group">
					<core:if test="${dto.isUserHistory eq 1 }">
						<input type="hidden" name="isUserHistory" value="1">
					<!-- //返回时隐藏域填充查询 -->
						<div style="display:none;">
				<div class="boarder">
				<div class="text-label"
					style="display: inline-block; margin-top: 2px;">
					<strong>服务项目(可多选) </strong>
				</div>
				<div class="checkbox "
					style="width: 400px; height: 80px; display: inline-block;">
					<ul>
						<core:forEach items="${serviceTypeDtos}" var="serviceTypeList"
							varStatus="status">
							<li class="checkbox-li"><input servicetype="servicetype" name="serviceType[${status.index}].serviceFlag" type="checkbox" <core:if test="${serviceTypeList.serviceFlag}">checked</core:if>>
							<input name="serviceType[${status.index}].code" type="hidden" value="${serviceTypeList.code }" >
							<input name="serviceType[${status.index}].serviceType" type="hidden" value="${serviceTypeList.serviceType }" >
							${serviceTypeList.serviceType}</li>
							<core:if test="${status.index eq 4 }">
								</br>
							</core:if>
						</core:forEach>
					</ul>
				</div>
			</div> 
			<div class="boarder">
				<div id="high10"></div>
				<label style="width: 120px"><strong>服务日期 </strong></label>
				<div style="display: none;">
					<input type="text" class="form-control1" id="day" name="day"
						style="width: 45px" maxLength="2" value="${dto.day}">&nbsp;≤<label
						id="maxRemindDays">${maxRemindDays}</label>天 <input type="text"
						class="form-control1" id="afterday" name="afterday"
						style="width: 45px" maxLength="2" value="${dto.afterday}">&nbsp;≤<label
						id="maxAfterRemindDays">${maxAfterRemindDays}</label>天&nbsp;&nbsp;
				</div>
				<input type="hidden" id="tempStart" name="tempStart" value="${ maxRemindDate }">
				推送日期 <input id="qRemindStartDate" name="qRemindStartDate" class="form-control1  Wdate"
					style="width: 150px" id="startDate" type="text" onclick="WdatePicker({dateFmt:'yyyy-MM'})" readonly="readonly"
					value='<core:if test="${empty dto.qRemindStartDate}">${ maxRemindDate }</core:if><core:if test="${!empty dto.qRemindStartDate}">${fn:substring(dto.qRemindStartDate,0,7)}</core:if>' />
				<div id="high10"></div>
				<div id="high10"></div>
			</div>
				<div class="boarder">
				<div id="high10"></div>
				<strong>姓名</strong>&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" class="form-control1"
					id="qMemberName" name="qMemberName" style="width: 150px"  value="${dto.qMemberName}">&nbsp;&nbsp;&nbsp; &nbsp;
					<strong>手机</strong>&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" class="form-control1"
					id="qMobliePhone" name="qMobliePhone" style="width: 150px"  value="${dto.qMobliePhone}">&nbsp;&nbsp;&nbsp; &nbsp;
					<strong>车牌</strong>&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" class="form-control1"
					id="qCarPlate" name="qCarPlate" style="width: 150px"  value="${dto.qCarPlate}">&nbsp;&nbsp;&nbsp; &nbsp;
				<div id="high10"></div>
				</div>
		<div>
			<div id="high10"></div>
			<div style="padding-left:170px">
								<button id="search" type="button" class="btn btn-success" onclick="search()"><i class="glyphicon glyphicon-search" style="color:#FFFFFF"></i>&nbsp;查询</button>
					<button type="reset" class="btn btn-success"><i class="glyphicon glyphicon-trash" style="color:#FFFFFF"></i>&nbsp;重置</button>
			</div>
			<div id="high10"></div>
		</div>
		<div id="high10"></div>
			<div style="margin-left: 25px">
				 <strong>重复发送</strong>&nbsp;<input name="resendFlag"
					type="checkbox">&nbsp;&nbsp;&nbsp;&nbsp;<strong>全部发送</strong><input type="checkbox" id="sendAllFlag" name="sendAllFlag" <core:if test='${dto.sendAllFlag}'>checked</core:if>>
			</div>
		</div>
			</core:if>		
						<div class="col-sm-2"></div>
						<label class="col-sm-2 control-label" for="qHMemberName">姓名</label>
						<core:if test="${dto.isUserHistory eq 1 }">
							<input name="qHMemberName"  type="hidden" value="${dto.qHMemberName}" />
							<div class="col-sm-2 control-label" style="text-align: left;">${dto.qHMemberName}</div>
						</core:if>
						<core:if test="${dto.isUserHistory ne 1 }">
						<input name="fromPage" type="hidden" value="remindHistory"/>
							<div class="col-sm-2">
							<input name="qHMemberName" class="form-control input-sm "
								id="qHMemberName" type="text" value="${dto.qHMemberName}" />
								</div>
						</core:if>
					<label class="col-sm-1 control-label" for="qHMobliePhone">手机</label>
						<core:if test="${dto.isUserHistory eq 1 }">
					<div class="col-sm-2 control-label" style="text-align: left;">
					<input name="qHMobliePhone"  type="hidden" value="${dto.qHMobliePhone}" />
							${dto.qHMobliePhone}
					</div>
						</core:if>
						<core:if test="${dto.isUserHistory ne 1 }">
						<div class="col-sm-2">
							<input name="qHMobliePhone" class="form-control input-sm "
								id="qHMobliePhone" type="text" value="${dto.qHMobliePhone}" />
								</div>
						</core:if>
					
<!-- 					<div class="col-sm-2"></div> -->
					<label class="col-sm-1 control-label" for="qHCarPlate">车牌</label>
					<core:if test="${dto.isUserHistory eq 1 }">
					<input name="qHCarPlate"  type="hidden" value="${dto.qHCarPlate}" />
						<div class="col-sm-2 control-label" style="text-align: left;">${dto.qHCarPlate}</div>
					</core:if>
					<core:if test="${dto.isUserHistory ne 1 }">
						<div class="col-sm-2">
							<input name="qHCarPlate" class="form-control input-sm"
								id="qHCarPlate" type="text" value="${dto.qHCarPlate}" />
						</div>
					</core:if>
					
					</div>
				</div>
		<div class="row">
		
			<core:if test="${dto.isUserHistory ne 1 }">
				<div class="form-group">
					<div class="col-sm-2"></div>
					<label class="col-sm-2 control-label" for="startDate">推送日期</label>
					<div class="col-sm-2">
						 <input id="qRemindStartDate" name="qRemindStartDate" class="form-control input-sm validate[length[0,100]]  Wdate"
						style="width: 150px" id="startDate" type="text" onclick="WdatePicker({dateFmt:'yyyy-MM'})" readonly="readonly"
						value='<core:if test="${empty dto.qRemindStartDate}">${ maxRemindDate }</core:if><core:if test="${!empty dto.qRemindStartDate}">${fn:substring(dto.qRemindStartDate,0,7)}</core:if>' />
					</div>
				</div>
			</core:if>
		
			<div class="form-group">

				<label class="col-sm-4 control-label" for="">服务项目</label>
				<core:if test="${dto.isUserHistory eq 1 }">
				<input name="qHServiceType"  type="hidden" value="${dto.qHServiceType}" />
					<div class="col-sm-2 control-label" style="text-align: left;">${dto.qHServiceType}</div>
				</core:if>
				<core:if test="${dto.isUserHistory ne 1 }">
				<div class="col-sm-6">
					<ul>
						<core:forEach items="${serviceTypeDtos}" var="serviceTypeList"
						varStatus="status">
						<li class="checkbox-li"><input servicetype="servicetype"
							name="serviceType[${status.index}].serviceFlag" type="checkbox"
							<core:if test="${serviceTypeList.serviceFlag}">checked</core:if>>
							<input name="serviceType[${status.index}].code" type="hidden"
							value="${serviceTypeList.code }"> <input
							name="serviceType[${status.index}].serviceType" type="hidden"
							value="${serviceTypeList.serviceType }">
							${serviceTypeList.serviceType}</li>
					</core:forEach>
					</ul>
				</div>
				</core:if>
			</div>


		</div>
		<core:if test="${dto.isUserHistory ne 1 }">
			<div style="text-align: center; margin-top: 10px;">
				<button type="button" class="btn btn-success" onclick="search()">
					<i class="glyphicon glyphicon-search" style="color: #FFFFFF"></i>&nbsp;查询
				</button>
				<button type="reset" class="btn btn-success">
					<i class="glyphicon glyphicon-trash" style="color: #FFFFFF" onclick="resertChange()"></i>&nbsp;重置
				</button>
				<button type="button" class="btn btn-success" value="返回 "
					onclick="returnRemind()">
					<i class="glyphicon glyphicon-share-alt" style="color: #FFFFFF"></i>&nbsp;返回
				</button>
			</div>
		</core:if>
		<core:if test="${dto.isUserHistory eq 1 }">
			<div style="text-align: center; margin-top: 10px;">
				<button type="button" class="btn btn-success" value="返回 "
					onclick="returnRemind()">
					<i class="glyphicon glyphicon-share-alt" style="color: #FFFFFF"></i>&nbsp;返回
				</button>
			</div>
		</core:if>
	<!-- /search_div -->
	<div class="spliter h_5"></div>
	<div class="page_info"></div>
	<div class="spliter h_10"></div>
	<!-- data_div -->
	<div id="dataTable" class="data_div">
		<table id="table" class="table " style="font-size: 85%">
			<thead>
				<tr>
					<th>姓名</th>
					<th>手机</th>
					<th>车牌</th>
					<th>保养项目</th>
					<th>使用产品</th>
					<th>推送信息</th>
					<th>推送日期</th>
				</tr>
			</thead>
			<tbody>
				<core:forEach items="${list}" var="list">
					<tr>
						<td>${list.memberName }</td>
						<td>${list.mobliePhone }</td>
						<td>${list.carPlate}</td>
						<td>${list.maintenanceItem }</td>
						<td>${list.lastPartBrand }</td>
						<td>${list.remindMsg }</td>
						<td><fmt:formatDate value="${list.remindDate}"
								pattern="yyyy-MM-dd HH:mm:ss" var="remindDate" />
							${fn:substring(remindDate, 0, 10)}&nbsp;&nbsp;&nbsp;&nbsp;</td>
					</tr>
				</core:forEach>
			</tbody>
		</table>
	</div>
	<!-- /data_div -->
	<!-- page_div -->
	<div class="page_div">
		<%@include file="../common/page.jsp"%>
	</div>
	<!-- /page_div -->
	</form:form>
	</div>
	<!-- /wrap -->
	</div>
	<!-- /content -->
</body>
</html>